############################################################################
# Copyright (c) 2024, John Doe          
#                                                     
#                                                                          
# Distributed under the terms of the BSD 3-Clause License.               
#                                                                          
# The full license is in the file LICENSE, distributed with this software. 
############################################################################

# xeus-xlang cmake module
# This module sets the following variables in your project::
#
#   xeus-xlang_FOUND - true if xeus-xlang was found on the system
#   xeus-xlang_INCLUDE_DIRS - the directory containing xeus-xlang headers
#   xeus-xlang_LIBRARY - the library for dynamic linking
#   xeus-xlang_STATIC_LIBRARY - the library for static linking

@PACKAGE_INIT@

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR};${CMAKE_MODULE_PATH}")

@XEUS_XLANG_CONFIG_CODE@

include(CMakeFindDependencyMacro)
find_dependency(xtl @xtl_REQUIRED_VERSION@)
find_dependency(xeus-zmq @xeus-zmq_REQUIRED_VERSION@)
find_dependency(cppzmq @cppzmq_REQUIRED_VERSION@)


if (NOT TARGET xeus-xlang AND NOT TARGET xeus-xlang-static)
    include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")

    if (TARGET xeus-xlang AND TARGET xeus-xlang-static)
        get_target_property(@PROJECT_NAME@_INCLUDE_DIR xeus-xlang INTERFACE_INCLUDE_DIRECTORIES)
        get_target_property(@PROJECT_NAME@_LIBRARY xeus-xlang LOCATION)
        get_target_property(@PROJECT_NAME@_STATIC_LIBRARY xeus-xlang-static LOCATION)
    elseif (TARGET xeus-xlang)
        get_target_property(@PROJECT_NAME@_INCLUDE_DIR xeus-xlang INTERFACE_INCLUDE_DIRECTORIES)
        get_target_property(@PROJECT_NAME@_LIBRARY xeus-xlang LOCATION)
    elseif (TARGET xeus-xlang-static)
        get_target_property(@PROJECT_NAME@_INCLUDE_DIR xeus-xlang-static INTERFACE_INCLUDE_DIRECTORIES)
        get_target_property(@PROJECT_NAME@_STATIC_LIBRARY xeus-xlang-static LOCATION)
        set(@PROJECT_NAME@_LIBRARY ${@PROJECT_NAME@_STATIC_LIBRARY})
    endif ()
endif ()
